package com.example.demo.entity.primary;

import javax.persistence.*;

/**
 * Created by dongjunpeng on 2017/10/12.
 */
@Entity
@Table(name = "quay_crane")
public class QuayCraneEntity {
    private int craneId;
    private String craneColor;
    private Byte frameWidth;
    private Byte craneHeight;
    private Byte gantryHeight;
    private Byte railSpan;
    private Byte outReach;
    private Byte backReach;
    private Byte horizontalBeamHeight;
    private Byte sillBeamHeight;
    private Byte laneWidth;
    private Byte laneAmount;
    private Byte cranePresetZoneWidth;
    private Byte cranePresetZoneHeight;
    private Byte rowBelowHorizontalBeam;
    private Byte rowAboveHorizontalBeam;
    private Byte xAxisxOffset;
    private Byte yAxisxOffset;

    @Id
    @Column(name = "crane_id")
    public int getCraneId() {
        return craneId;
    }

    public void setCraneId(int craneId) {
        this.craneId = craneId;
    }

    @Basic
    @Column(name = "crane_color")
    public String getCraneColor() {
        return craneColor;
    }

    public void setCraneColor(String craneColor) {
        this.craneColor = craneColor;
    }

    @Basic
    @Column(name = "frame_width")
    public Byte getFrameWidth() {
        return frameWidth;
    }

    public void setFrameWidth(Byte frameWidth) {
        this.frameWidth = frameWidth;
    }

    @Basic
    @Column(name = "crane_height")
    public Byte getCraneHeight() {
        return craneHeight;
    }

    public void setCraneHeight(Byte craneHeight) {
        this.craneHeight = craneHeight;
    }

    @Basic
    @Column(name = "gantry_height")
    public Byte getGantryHeight() {
        return gantryHeight;
    }

    public void setGantryHeight(Byte gantryHeight) {
        this.gantryHeight = gantryHeight;
    }

    @Basic
    @Column(name = "rail_span")
    public Byte getRailSpan() {
        return railSpan;
    }

    public void setRailSpan(Byte railSpan) {
        this.railSpan = railSpan;
    }

    @Basic
    @Column(name = "out_reach")
    public Byte getOutReach() {
        return outReach;
    }

    public void setOutReach(Byte outReach) {
        this.outReach = outReach;
    }

    @Basic
    @Column(name = "back_reach")
    public Byte getBackReach() {
        return backReach;
    }

    public void setBackReach(Byte backReach) {
        this.backReach = backReach;
    }

    @Basic
    @Column(name = "horizontal_beam_height")
    public Byte getHorizontalBeamHeight() {
        return horizontalBeamHeight;
    }

    public void setHorizontalBeamHeight(Byte horizontalBeamHeight) {
        this.horizontalBeamHeight = horizontalBeamHeight;
    }

    @Basic
    @Column(name = "sill_beam_height")
    public Byte getSillBeamHeight() {
        return sillBeamHeight;
    }

    public void setSillBeamHeight(Byte sillBeamHeight) {
        this.sillBeamHeight = sillBeamHeight;
    }

    @Basic
    @Column(name = "lane_width")
    public Byte getLaneWidth() {
        return laneWidth;
    }

    public void setLaneWidth(Byte laneWidth) {
        this.laneWidth = laneWidth;
    }

    @Basic
    @Column(name = "lane_amount")
    public Byte getLaneAmount() {
        return laneAmount;
    }

    public void setLaneAmount(Byte laneAmount) {
        this.laneAmount = laneAmount;
    }

    @Basic
    @Column(name = "crane_preset_zone_width")
    public Byte getCranePresetZoneWidth() {
        return cranePresetZoneWidth;
    }

    public void setCranePresetZoneWidth(Byte cranePresetZoneWidth) {
        this.cranePresetZoneWidth = cranePresetZoneWidth;
    }

    @Basic
    @Column(name = "crane_preset_zone_height")
    public Byte getCranePresetZoneHeight() {
        return cranePresetZoneHeight;
    }

    public void setCranePresetZoneHeight(Byte cranePresetZoneHeight) {
        this.cranePresetZoneHeight = cranePresetZoneHeight;
    }

    @Basic
    @Column(name = "row_below_horizontal_beam")
    public Byte getRowBelowHorizontalBeam() {
        return rowBelowHorizontalBeam;
    }

    public void setRowBelowHorizontalBeam(Byte rowBelowHorizontalBeam) {
        this.rowBelowHorizontalBeam = rowBelowHorizontalBeam;
    }

    @Basic
    @Column(name = "row_above_horizontal_beam")
    public Byte getRowAboveHorizontalBeam() {
        return rowAboveHorizontalBeam;
    }

    public void setRowAboveHorizontalBeam(Byte rowAboveHorizontalBeam) {
        this.rowAboveHorizontalBeam = rowAboveHorizontalBeam;
    }

    @Basic
    @Column(name = "x_axisx_offset")
    public Byte getxAxisxOffset() {
        return xAxisxOffset;
    }

    public void setxAxisxOffset(Byte xAxisxOffset) {
        this.xAxisxOffset = xAxisxOffset;
    }

    @Basic
    @Column(name = "y_axisx_offset")
    public Byte getyAxisxOffset() {
        return yAxisxOffset;
    }

    public void setyAxisxOffset(Byte yAxisxOffset) {
        this.yAxisxOffset = yAxisxOffset;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        QuayCraneEntity that = (QuayCraneEntity) o;

        if (craneId != that.craneId) return false;
        if (craneColor != null ? !craneColor.equals(that.craneColor) : that.craneColor != null) return false;
        if (frameWidth != null ? !frameWidth.equals(that.frameWidth) : that.frameWidth != null) return false;
        if (craneHeight != null ? !craneHeight.equals(that.craneHeight) : that.craneHeight != null) return false;
        if (gantryHeight != null ? !gantryHeight.equals(that.gantryHeight) : that.gantryHeight != null) return false;
        if (railSpan != null ? !railSpan.equals(that.railSpan) : that.railSpan != null) return false;
        if (outReach != null ? !outReach.equals(that.outReach) : that.outReach != null) return false;
        if (backReach != null ? !backReach.equals(that.backReach) : that.backReach != null) return false;
        if (horizontalBeamHeight != null ? !horizontalBeamHeight.equals(that.horizontalBeamHeight) : that.horizontalBeamHeight != null)
            return false;
        if (sillBeamHeight != null ? !sillBeamHeight.equals(that.sillBeamHeight) : that.sillBeamHeight != null)
            return false;
        if (laneWidth != null ? !laneWidth.equals(that.laneWidth) : that.laneWidth != null) return false;
        if (laneAmount != null ? !laneAmount.equals(that.laneAmount) : that.laneAmount != null) return false;
        if (cranePresetZoneWidth != null ? !cranePresetZoneWidth.equals(that.cranePresetZoneWidth) : that.cranePresetZoneWidth != null)
            return false;
        if (cranePresetZoneHeight != null ? !cranePresetZoneHeight.equals(that.cranePresetZoneHeight) : that.cranePresetZoneHeight != null)
            return false;
        if (rowBelowHorizontalBeam != null ? !rowBelowHorizontalBeam.equals(that.rowBelowHorizontalBeam) : that.rowBelowHorizontalBeam != null)
            return false;
        if (rowAboveHorizontalBeam != null ? !rowAboveHorizontalBeam.equals(that.rowAboveHorizontalBeam) : that.rowAboveHorizontalBeam != null)
            return false;
        if (xAxisxOffset != null ? !xAxisxOffset.equals(that.xAxisxOffset) : that.xAxisxOffset != null) return false;
        if (yAxisxOffset != null ? !yAxisxOffset.equals(that.yAxisxOffset) : that.yAxisxOffset != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = craneId;
        result = 31 * result + (craneColor != null ? craneColor.hashCode() : 0);
        result = 31 * result + (frameWidth != null ? frameWidth.hashCode() : 0);
        result = 31 * result + (craneHeight != null ? craneHeight.hashCode() : 0);
        result = 31 * result + (gantryHeight != null ? gantryHeight.hashCode() : 0);
        result = 31 * result + (railSpan != null ? railSpan.hashCode() : 0);
        result = 31 * result + (outReach != null ? outReach.hashCode() : 0);
        result = 31 * result + (backReach != null ? backReach.hashCode() : 0);
        result = 31 * result + (horizontalBeamHeight != null ? horizontalBeamHeight.hashCode() : 0);
        result = 31 * result + (sillBeamHeight != null ? sillBeamHeight.hashCode() : 0);
        result = 31 * result + (laneWidth != null ? laneWidth.hashCode() : 0);
        result = 31 * result + (laneAmount != null ? laneAmount.hashCode() : 0);
        result = 31 * result + (cranePresetZoneWidth != null ? cranePresetZoneWidth.hashCode() : 0);
        result = 31 * result + (cranePresetZoneHeight != null ? cranePresetZoneHeight.hashCode() : 0);
        result = 31 * result + (rowBelowHorizontalBeam != null ? rowBelowHorizontalBeam.hashCode() : 0);
        result = 31 * result + (rowAboveHorizontalBeam != null ? rowAboveHorizontalBeam.hashCode() : 0);
        result = 31 * result + (xAxisxOffset != null ? xAxisxOffset.hashCode() : 0);
        result = 31 * result + (yAxisxOffset != null ? yAxisxOffset.hashCode() : 0);
        return result;
    }
}
